import request from '/@/utils/request';

export function saleStoreDetailApi() {
    return {
        // 查询参数列表
        getTableData(data: object) {
            return request({
                url: '/sale/commodity/detail/list',
                method: 'post',
                data
            })
        },
        // 獲取詳情
        getInfo: (id: number) => {
            return request({
                url: '/sale/commodity/detail/' + id,
                method: 'get'
            })
        },
        addRecord: (data: object) => {
            return request({
                url: '/sale/commodity/detail',
                method: 'post',
                data: data
            });
        },
        updateRecord: (data: object) => {
            return request({
                url: '/sale/commodity/detail',
                method: 'put',
                data: data
            });
        },
        delRecord: (data: object) => {
            return request({
                url: '/sale/commodity/detail',
                method: 'delete',
                data: data
            });
        },
        findAll: () => {
            return request({
                url: '/sale/commodity/detail/all',
                method: 'post'
            })
        },
        exportRecord: (data: object) => {
            return request({
                url: '/sale/commodity/detail/export',
                method: 'download',
                data: data
            });
        }
    }
}

